﻿<%@ Page Title="" Language="C#" MasterPageFile="M.master" %>
<%@ Register src="../module/Types-List.ascx" tagname="Types" tagprefix="inal" %>
<script runat="server">
    public int Item_Id = 0;
    public Text MyText;
    public string RealText;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["id"] != null)
            {
                Item_Id = Convert.ToInt32(Request.QueryString["Id"].ToString().Trim());
                MyText = new Text(Item_Id,"",false);
                RealText = FormatHtmlCode(MyText.Item_Story);
            }
        }
    }
    public string FormatHtmlCode(string Text_Value)
    {
        /* 多余的空格处理 */
        Text_Value = Text_Value.Replace("&amp;", "&");
        Text_Value = Text_Value.Replace("&nbsp;", " ");
        //Text_Value = Text_Value.Replace("  ", "");


        /* 双引号处理 */
        Text_Value = Text_Value.Replace("&quot;", "\"");
        Text_Value = Text_Value.ToLower();

        Text_Value = Text_Value.Replace("&lt;", "<");
        Text_Value = Text_Value.Replace("&gt;", ">");

        Text_Value = Text_Value.Replace("<br />", "");
        Text_Value = Text_Value.Replace("<br>", "");

        Text_Value = Text_Value.Replace("/pulgin/kindeditor/asp.net/../../", "");
        //Text_Value = Text_Value.Replace("\n", "");

        /* 优酷播放器进行重编 */
        Text_Value = Text_Value.Replace("<embed", "<embed allowfullscreen=\"true\"");
        /* 图片转换手机版模式 */
        Text_Value = Text_Value.Replace("_V.jpg", "_ss.jpg");
        
        Text_Value = Utils.HtmlDecode(Text_Value);
        return Text_Value;
    }
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<title><%=MyText.Item_Title %></title>
<link href="../Pulgin/kindeditor-4.1/plugins/code/shCoreEclipse.css" rel="stylesheet" />
<script type="text/javascript" src="../Pulgin/kindeditor-4.1/plugins/code/shCore.js"></script>
<script type="text/javascript" src="../Pulgin/kindeditor-4.1/plugins/code/shBrushJScript.js"></script>
<script type="text/javascript" src="../Pulgin/kindeditor-4.1/plugins/code/shBrushCSharp.js"></script>
<script type="text/javascript" src="../Pulgin/kindeditor-4.1/plugins/code/shBrushCss.js"></script>
<script type="text/javascript" src="../Pulgin/kindeditor-4.1/plugins/code/shBrushSql.js"></script>
<script type="text/javascript" src="../Pulgin/kindeditor-4.1/plugins/code/shBrushXml.js"></script>
<script type="text/javascript">SyntaxHighlighter.all();</script>
<link href="../Pulgin/kindeditor-4.1/plugins/code/must.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="ch10"></div>
    <div id="View">
        <h2><%=MyText.Item_Title %></h2>
        <div id="Text_Info"><%=Lang.Show("Published")%> : <%=MyText.Item_Time.ToString("yyyy/MM/dd HH:mm") %>  </div>
        <div id="Content"><%=RealText%></div>
    </div>
</asp:Content>

